package com.ydl.controller;

import com.ydl.common.util.ResultVo;
import com.ydl.entry.vo.goods.UpdateGoodsParam;
import com.ydl.entry.vo.order.AddOrderParam;
import com.ydl.entry.vo.order.DeleteOrderParam;
import com.ydl.entry.vo.order.QueryOrderParam;
import com.ydl.entry.vo.user.UpdateUserParam;
import com.ydl.service.GoodsOrderService;
import com.ydl.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/goods_order")
public class GoodsOrderController {

    @Autowired
    private GoodsOrderService goodsOrderService;


    @PostMapping("/list")
    public ResultVo list(@RequestBody QueryOrderParam queryOrderParam) {
        return goodsOrderService.list(queryOrderParam);
    }

    @PostMapping("/add")
    public ResultVo add(@RequestBody AddOrderParam addOrderParam) {
        return goodsOrderService.add(addOrderParam);
    }

    @PostMapping("/update")
    public ResultVo update(@RequestBody UpdateGoodsParam updateGoodsParam) {
        return goodsOrderService.update(updateGoodsParam);
    }

    @PostMapping("/del")
    public ResultVo delete(@RequestBody DeleteOrderParam deleteOrderParam) {
        return goodsOrderService.delete(deleteOrderParam);
    }

}
